package com.group.his.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.group.his.entity.User;
import com.group.his.mapper.BUserMapper;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 */
@Service
public class BUserServiceImpl extends ServiceImpl<BUserMapper, User> implements com.group.his.service.BUserService {

    @Override
    public Object login(String username, String password) {
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq(com.group.his.entity.User.PASSWORD,password);
        queryWrapper.eq(com.group.his.entity.User.USERNAME,username);
        JSONObject jsonObject=new JSONObject();
        if(list(queryWrapper).size()>0){
            jsonObject.put("code",200);
            jsonObject.put("msg","登录成功");
            return jsonObject;
        }
        jsonObject.put("code",500);
        jsonObject.put("msg","登录失败");
        return jsonObject;
    }
}
